<h2>My Message Detail</h2>
<table cellpadding="5">
    <tr>
        <td style="text-align: right; font-weight: bold;"><?php echo __('FROM')?> :</td>
        <td><?php echo $currentUserDetails['User']['e_name'];?></td>
        <td><?php echo __('ROLE');?> :</td>
        <td colspan="2"><?php echo empty($currentUserDetails['User']['role_id']) ? 'Admin' : $userRoles[$currentUserDetails['User']['role_id']];?></td>
    </tr>
    <tr>
        <td colspan="5">&nbsp;</td>
    </tr>
    <tr>
        <td style="text-align: right; font-weight: bold;"><?php echo __('TO')?> :</td>
        <td><?php echo __('RECIPIENTS')?> </td>
        <td><?php echo __('SELECT');?></td>
        <td><?php echo __('ROLE');?></td>
        <td><?php echo __('LEAVE_STATUS')?></td>
    </tr><?php  if(!empty($mailData['UserMail'])){ $i = 0; foreach($mailData['UserMail'] as $users){?>
    <tr>
        <td>&nbsp;</td>
        <td><?php echo $users['User']['e_name'];?></td>
        <td><?php echo $this->Form->input('Payroll.receiver.', array('id' => 'receiver_'.$i, 'type' => 'checkbox', 'value' => $users['User']['id'], 'multiple' => TRUE, 'hiddenField' => false, 'checked' => true));?></td>
        <td><?php echo $userRoles[$users['User']['role_id']];?></td>
        <td><?php echo ($users['User']['on_leave'] == 1) ? __('ON_LEAVE') : '';?></td>
    </tr><?php $i++; }} else {?>
    <tr>
        <td colspan="5"><?php __('NO_USER_ALLOCATED');?></td>
    </tr> <?php } ?>
    <tr>
        <td colspan="5">&nbsp;</td>
    </tr>
    <tr>
        <td style="text-align: right; font-weight: bold;"><?php echo __('SUBJECT')?> :</td>
        <td colspan="4"><?php echo $mailData['Mail']['mail_type'];?> part time payroll (from <?php echo  empty($currentUserDetails['User']['role_id']) ? 'Admin' : $userRoles[$currentUserDetails['User']['role_id']];?>)</td>
    </tr>
    <tr>
        <td style="text-align: right; font-weight: bold;"><?php echo __('MESSAGE')?> :</td>
        <td colspan="4"><?php echo $this->Form->input('Payroll.message', array('type' => 'select', 'options' => $messageOptions, 'label' => FALSE, 'style' =>'width:100%', 'selected' => $mailData['Mail']['message_id']));?></td>
    </tr>
    <tr>
        <td style="text-align: right; font-weight: bold;"><?php echo __('REMARK')?> :</td>
        <td colspan="4"><?php echo $this->Form->input('Payroll.remark', array('type' => 'textarea', 'label' => FALSE, 'style' =>'resize:none; width:98%', 'value' => $mailData['Mail']['remark']));?></td>
    </tr>
</table>